package com.huangliusong.aspectJ.demo2;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class MyAspectXml {

    //前置通知
    public void before(JoinPoint joinPoint){
        System.out.println("xml前置通知"+joinPoint.getArgs());
    }

    //后置通知
    public void afterReturing(Object result){
        System.out.println("xml后置通知"+result);
    }

    //环绕通知
    public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("xml环绕通知---前" + joinPoint);
       Object o= joinPoint.proceed();
        System.out.println("xml环绕通知---hou" + joinPoint);
        return  o;
    }

    //异常
    public void afterThrouw(){
        System.out.println("xml异常通知++++++++++++++++++++++++");
    }

    //最终通知
    public void after(){
        System.out.println("xml最终通知++++++++++++++++++++++++");
    }
}
